package com.syni.mdd.yhd.common.all.controller.protect.userReceCoupon.v4;

import com.syni.mdd.sjb.common.component.utils.common.annotations.CheckParams;
import com.syni.mdd.sjb.common.component.utils.common.annotations.EntranceCheck;
import com.syni.mdd.yhd.common.all.dto.requestDto.BaseReDto;
import com.syni.mdd.yhd.common.all.service.BmsUserReceCouponService;
import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @className BmsUserReceCouponController
 * @description TOO
 * @Author cfx
 * @DATE 2019/9/18 22:20
 * @VERSION 1.0
 **/
@RestController
@RequestMapping("/v4/userReceCoupon")
public class BmsUserReceCouponController_V4 {

    @Autowired
    BmsUserReceCouponService bmsUserReceCouponService;

    /**
     * @Description: 订单页面获取卡券接口
     * @return: Map
     * @Author: cfx
     * @Date: 2019/4/8
     **/
    @CheckParams(checkAuth = true)
    @PostMapping("/getMyFullCoupon")
    public Map<String,Object> getMyFullCoupon(@RequestBody ParamsMap paramsMap){
        return bmsUserReceCouponService.getMyFullCoupon_V4(paramsMap);
    }

    /**
     * @Description: 订单页面获取卡券接口(新)
     * @return: Map
     * @Author: cfx
     * @Date: 2019/4/8
     **/
    @CheckParams(checkAuth = true)
    @PostMapping("/getMyCoupons")
    public Map<String,Object> getMyCoupons(@RequestBody ParamsMap paramsMap){
        return bmsUserReceCouponService.getMyCoupons(paramsMap);
    }

    /**
     * @Description: 我的卡券接口
     * @return: Map
     * @Author: cfx
     * @Date: 2019/4/8
     */
    @EntranceCheck(checkAuth = true)
    @PostMapping("/userGetCoupon")
    public Map<String,Object> userGetCoupon(@RequestBody BaseReDto baseReDto){
        return bmsUserReceCouponService.userGetCoupon_V4(baseReDto);
    }

    /**
     * @Description: 我的卡券接口（失效券）
     * @return: Map
     * @Author: cfx
     * @Date: 2019/4/8
     * @param paramsMap
     */
    @CheckParams(checkAuth = true)
    @PostMapping("/userGetOverExpireCoupon")
    public Map<String,Object> userGetOverExpireCoupon(@RequestBody ParamsMap paramsMap){
        return bmsUserReceCouponService.userGetOverExpireCoupon_V4(paramsMap);
    }
}
